package com.example.fenye.model;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

public class PageInfos<T> {
    @Getter
    @Setter
    private Integer pageSize;
    @Getter
    @Setter
    private Integer pageNum;
    @Getter
    @Setter
    private Integer total;
    @Getter
    @Setter
    private List<T> list;

    private Integer start;


    public Integer getStart() {
        if(this.pageNum==null||this.pageSize==null){
            return null;
        }
        return (this.pageNum-1)*this.pageSize;
    }



    public PageInfos() {
        this.pageSize = 5;
        this.pageNum = 1;
    }

    public PageInfos(Integer pageSize, Integer pageNum) {
        this.pageSize = pageSize;
        this.pageNum = pageNum;
    }
}

